Security News
Python Overtakes JavaScript as Top Programming Language on GitHub
Python becomes GitHub's top language in 2024, driven by AI and data science projects, while AI-powered security tools are gaining adoption.
@graphql-codegen/plugin-helpers
Advanced tools
The @graphql-codegen/plugin-helpers package provides utility functions and types that are used to develop plugins for GraphQL Code Generator. It helps with the creation of custom plugins by providing common functionalities such as schema and document handling, plugin validation, and configuration management.
Validate Plugins
This feature allows developers to validate the structure of plugins to ensure they conform to the expected interface required by GraphQL Code Generator.
const { validatePlugins } = require('@graphql-codegen/plugin-helpers');
const plugins = [
{ plugin: require('some-graphql-codegen-plugin') }
];
validatePlugins(plugins);
Normalize Output Parameters
This utility normalizes output parameters, which can be used to handle file paths and names in a consistent manner across different plugins.
const { normalizeOutputParam } = require('@graphql-codegen/plugin-helpers');
const output = 'path/to/output.ts';
const normalizedOutput = normalizeOutputParam(output);
Create Schema AST
This function is used to create a GraphQL schema AST from a GraphQL schema object, which can then be used by plugins to generate code.
const { createSchemaAst } = require('@graphql-codegen/plugin-helpers');
const { buildSchema } = require('graphql');
const schema = buildSchema(`type Query { hello: String }`);
const schemaAst = createSchemaAst(schema);
The graphql-tools package is a set of utilities for working with GraphQL schemas in JavaScript. It provides functionalities for schema stitching, mocking, and more. While it overlaps with some of the schema handling features of @graphql-codegen/plugin-helpers, it is more focused on schema manipulation rather than code generation plugin development.
graphql-config is a tool for loading GraphQL configuration files. It helps developers manage and share configurations for their GraphQL projects. While it also deals with GraphQL configurations, it is not specifically tailored for code generation plugin development like @graphql-codegen/plugin-helpers.
FAQs
GraphQL Code Generator common utils and types
We found that @graphql-codegen/plugin-helpers demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 4 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Python becomes GitHub's top language in 2024, driven by AI and data science projects, while AI-powered security tools are gaining adoption.
Security News
Dutch National Police and FBI dismantle Redline and Meta infostealer malware-as-a-service operations in Operation Magnus, seizing servers and source code.
Research
Security News
Socket is tracking a new trend where malicious actors are now exploiting the popularity of LLM research to spread malware through seemingly useful open source packages.